package controllers;

import java.io.IOException;
import java.net.URLDecoder;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class OutServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException {
		
		String path = ((HttpServletRequest) request).getRequestURI();
		String name = URLDecoder.decode(path.toLowerCase().replaceAll(request.getServletPath() + "/", ""),"UTF-8");
		
		request.setAttribute("name", name);
		request.setAttribute("title", "whoisdata.us - Provice service Whois");
		request.setAttribute("keywords", name + ", whois, whois data, whois domain, domain whois, whois services, showsiteinfo, domainworlds, web20vn");
		request.setAttribute("description", "Find more infomation about " + name + " on other site.");
		try {
			request.getRequestDispatcher("/pages/out.jsp").forward(request, response);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
